package com.yc.baihe.beans;

import java.io.Serializable;

import com.yc.baihe.dao.MD5Encryption;

public class AdminUser implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private int aid;//管理员编号
	private String pwd;//密码
	private String aname;//真实姓名
	private String tel;//联系电话
	private String email;//邮箱
	private int status;
	private String temp1;//备用
	private String temp2;//备用
	
	@Override
	public String toString() {
		return "AdminUser [aid=" + aid + ", pwd=" + pwd + ", aname=" + aname
				+ ", tel=" + tel + ", email=" + email + ", status=" + status
				+ ", temp1=" + temp1 + ", temp2=" + temp2 + "]";
	}

	public int getAid() {
		return aid;
	}

	public void setAid(int aid) {
		this.aid = aid;
	}

	public String getPwd() {
		return pwd;
	}
	public String getPwds() {
		return MD5Encryption.createPassword(pwd);
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getAname() {
		return aname;
	}

	public void setAname(String aname) {
		this.aname = aname;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getStatus() {
		return status;
	}
	public String getStatuss() {
		if(this.status==0){
			return "锁定";
		}else{
			return "正常";
		}
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getTemp1() {
		return temp1;
	}

	public void setTemp1(String temp1) {
		this.temp1 = temp1;
	}

	public String getTemp2() {
		return temp2;
	}

	public void setTemp2(String temp2) {
		this.temp2 = temp2;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public AdminUser(int aid, String pwd, String aname, String tel,
			String email, int status, String temp1, String temp2) {
		super();
		this.aid = aid;
		this.pwd = pwd;
		this.aname = aname;
		this.tel = tel;
		this.email = email;
		this.status = status;
		this.temp1 = temp1;
		this.temp2 = temp2;
	}

	public AdminUser() {
		super();
		// TODO Auto-generated constructor stub
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + aid;
		result = prime * result + ((aname == null) ? 0 : aname.hashCode());
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result + ((pwd == null) ? 0 : pwd.hashCode());
		result = prime * result + status;
		result = prime * result + ((tel == null) ? 0 : tel.hashCode());
		result = prime * result + ((temp1 == null) ? 0 : temp1.hashCode());
		result = prime * result + ((temp2 == null) ? 0 : temp2.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AdminUser other = (AdminUser) obj;
		if (aid != other.aid)
			return false;
		if (aname == null) {
			if (other.aname != null)
				return false;
		} else if (!aname.equals(other.aname))
			return false;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (pwd == null) {
			if (other.pwd != null)
				return false;
		} else if (!pwd.equals(other.pwd))
			return false;
		if (status != other.status)
			return false;
		if (tel == null) {
			if (other.tel != null)
				return false;
		} else if (!tel.equals(other.tel))
			return false;
		if (temp1 == null) {
			if (other.temp1 != null)
				return false;
		} else if (!temp1.equals(other.temp1))
			return false;
		if (temp2 == null) {
			if (other.temp2 != null)
				return false;
		} else if (!temp2.equals(other.temp2))
			return false;
		return true;
	}
	
}
